home *** CD-ROM | disk | FTP | other *** search
- Path: sn.no!not-for-mail
- From: christon (Christopher Naas)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: More
- Date: 21 Jan 1996 17:29:15 +0100
- Organization: SN Internett
- Message-ID: <1551.6594T1046T1254@Th0r.foo.bar>
- References: <9601201749.AA00046@cliffe.demon.co.uk>
- NNTP-Posting-Host: sinsen.sn.no
- X-Newsreader: THOR 2.21 (Amiga;SOUP)
-
- Steven Chapman wrote:
-
- >Thanks for the last lot of help but i am looking for something like this
- >but when i try too compile it i get
- [..]
-
- #include <proto/dos.h>
- #include <proto/icon.h>
- #include <stdio.h>
-
-
- struct DiskObject *kFindDiskObject (char *);
- struct DiskObject *icon = NULL, *toolicon = NULL;
-
-
- void __main (char *Line)
- {
- UBYTE **tooltypes,
- *textp;
- BPTR file;
-
- if (icon = kFindDiskObject (Line))
- {
- tooltypes = (char **)icon->do_ToolTypes;
-
- if (file = Open ("T:xx", MODE_READWRITE))
- {
- textp = FindToolType (tooltypes, "PROG");
-
- Execute (textp, 0, file);
-
- Delay (200);
- Close (file);
- }
-
- FreeDiskObject (icon);
- }
- }
-
-
-
-
- struct DiskObject *kFindDiskObject (char *Line)
- {
- struct DiskObject *DiskObj;
- char NameAndPath[512],
- *a;
-
-
- if (_WBenchMsg)
- {
- sprintf (NameAndPath, "PROGDIR:%s\0", WBenchMsg->sm_ArgList->wa_Name);
-
- if (DiskObj = GetDiskObject (NameAndPath))
- return DiskObj;
- }
-
- *Line++;
- a = Line;
-
- while (*a!='"')
- *a++;
-
- *a='\0';
-
- sprintf (NameAndPath, "%s", Line);
-
- if (DiskObj = GetDiskObject (NameAndPath))
- return DiskObj;
-
- if (DiskObj = GetDefDiskObject (WBTOOL))
- return DiskObj;
-
- return NULL;
- }
-
-
- You should replace Execute with dos.library/SystemTagList.
-
-
- --
- Christopher Landmark Naas o EMail: christon@sn.no
- LoungeBar Development o WWW: http://www.sn.no/~christon/
- Former Reg. Amiga Developer o IRC: KarmaComa
-